package com.sxbbc.common.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sxbbc.common.basics.utils.statics.StaticUtils;
import com.sxbbc.common.core.entity.jz.CRechargeAmountset;
import com.sxbbc.common.core.mapper.jz.CRechargeAmountsetMapper;
import com.sxbbc.common.core.service.ICRechargeAmountsetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 充值金额规则设置 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-10-30
 */
@Service
public class CRechargeAmountsetServiceImpl extends ServiceImpl<CRechargeAmountsetMapper, CRechargeAmountset> implements ICRechargeAmountsetService {

    /**
     * 查询条件封装
     * @param amountset
     * @return
     */
    @Override
    public QueryWrapper<CRechargeAmountset> queryWrapper(CRechargeAmountset amountset) {
        QueryWrapper<CRechargeAmountset> wrapper = new QueryWrapper<>();
        if(amountset.getStatus() != null){
            wrapper.eq("status", StaticUtils.STATUS_YES);
        }
        if( amountset.getType() != null){
            wrapper.eq("type", amountset.getType());
        }
        return wrapper;
    }
}
